import http from "../../../libs/http";

/**
 * 获取文章列表
 * @param {Object} option
 * @param {Number} option.limit - 请求条数
 * @param {Number} option.articleType - 文章栏目主键id（articleTypeId）
 * @return {Promise} Array
 */
export async function queryArticleList(option) {
  const url = "/client/queryArticleList.htm";
  const params = {
    limit: 10,
    ...option,
  };
  const res = await http.get(url, {
    params,
  });
  return res;
}

/**
 * 基础—选股字段数据区间(可视化选股) (tang)
 */
export async function queryOption(option) {
  const url = "/searchserver/api/queryOption/valueRange.htm";
  const params = {
    ...option,
  };
  const res = await http.get(url, {
    params
  });
  return res.data;
}

/**
 * 基础—版块 (tang)
 */
export async function getblockList() {
  const url = "/searchserver/api/queryOption/blockListByInt.htm";
  const params = {
    blockType: 1021
  };
  const res = await http.get(url, {
    params
  });
  return res.data;
}

/**
 * 指数列表 (tang)
 */
export async function getIndexList() {
  const url = "/searchserver/api/queryOption/indexList.htm";
  const params = {
    
  };
  const res = await http.get(url, {
    params
  });
  return res.data;
}




/**
 * 选股search (tang)
 */
export async function queryJson(option) {
  const url = "/searchserver/api/search/andOrQueryJson.htm";
  const params = {
    // order:"desc",
    // orderName:"epsp",
    // showField:"",
    page:1,
    pageSize:100,
    ...option
  };
  const data = JSON.stringify(params);
  console.log(data)
  const res = await http.post(url, data);
  return res;
}


